﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
namespace WebApi.Models
{
    public class OrderModel
    {
        public int oid { get; set; }
        public int uid { get; set; }
        public string orderno = string.Empty;
        public int orderType { get; set; }
        public double total { get; set; }
        public string createTime = string.Empty;
        public int hdid { get; set; }
        public int tid { get; set; }
        public int ticketNum { get; set; }
        public int orderStatus { get; set; }//订单状态 0 待支付 1待使用  2已完成，3已取消，4退款中，5已退款

        public static OrderModel GetModel(DataRow dr)
        {
            OrderModel model = new OrderModel();
            model.oid = Convert.ToInt32(dr["oid"]);
            model.uid = Convert.ToInt32(dr["uid"]);
            model.orderno = Convert.ToString(dr["orderno"]);
            model.orderType = Convert.ToInt32(dr["orderType"]);
            model.total = Convert.ToDouble(dr["total"]);
            model.createTime = Convert.ToString(dr["createTime"]);
            model.hdid = Convert.ToInt32(dr["hdid"]);
            model.tid = Convert.ToInt32(dr["tid"]);
            model.ticketNum = Convert.ToInt32(dr["ticketNum"]);
            model.orderStatus = Convert.ToInt32(dr["orderStatus"]);
            return model;
        }
    }
}